<!DOCTYPE HTML>
<html>
<head>
<#include "/script.ftl">
<title>三方任务统计表</title>
<link rel="stylesheet" type="text/css" href="../static/eth/css/report.css" />
<script type="text/javascript" src="../static/eth/js/jElass.js"></script>
<script type="text/javascript" src="../static/eth/js/jElassExec.js"></script>
<script type="text/javascript" src="../static/eth/js/report.js"></script>
</head>
<body id="body" class="report_body">
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i> 首页
		<span class="c-gray en">&gt;</span> 统计
		<span class="c-gray en">&gt;</span> 三方任务统计表
	</nav>
	<div class="page-container">
		<div class="report_head">
			<form id="form" method="get" action="tripartite" autocomplete="off">
				<div class="report_line1">
					<div class="report_item1 cl">
						<label>日期条件</label>
						<select name="dateCondition" id="date_condition" class="input-text">
							<option value="operatoringTime" <#if (cond.dateCondition)! ='operatoringTime'>selected="selected"</#if>">出票时间</option>
							<option value="departureDate" <#if (cond.dateCondition)! ='departureDate'>selected="selected"</#if>">乘机时间</option>
						</select>
					</div>
					<div class="report_item3 cl date_condition_div others">
						<label class="label_class1">出票起止时间</label>
						<input type="text" name="operatoringTimeStartStr" value="${(cond.operatoringTimeStartStr)!''}" class="input-text Wdate" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'operatoringTimeEndStr\')}'})" autocomplete="off" id="operatoringTimeStartStr" placeholder="yyyy-MM-dd">
						<label class="label_class2">至</label>
						<input type="text" name="operatoringTimeEndStr" value="${(cond.operatoringTimeEndStr)!''}" class="input-text Wdate" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'operatoringTimeStartStr\')}'})" autocomplete="off" id="operatoringTimeEndStr" placeholder="yyyy-MM-dd">
					</div>
					<div class="report_item3 cl date_condition_div others">
						<label class="label_class1">乘机起止时间</label>
						<input type="text" name="departureDateStartStr" value="${(cond.departureDateStartStr)!''}" class="input-text Wdate" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'departureDateEndStr\')}'})" autocomplete="off" id="departureDateStartStr" placeholder="yyyy-MM-dd">
						<label class="label_class2">至</label>
						<input type="text" name="departureDateEndStr" value="${(cond.departureDateEndStr)!''}" class="input-text Wdate" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'departureDateStartStr\')}'})" autocomplete="off" id="departureDateEndStr" placeholder="yyyy-MM-dd">
					</div>
				</div>
				<div class="div_bar">
					<div class="report_line2">
						<div class="report_item1 cl">
							<label>航司</label>
							<input type="text" name="airlineName" id="airlineName" value="${(cond.airlineName)!}" onClick="AirlineCode(airlineName,airline)" class="input-text" >
							<input type="hidden" name="airline" id="airline" value="${(cond.airline)!}" >
						</div>
						<div class="report_item1 cl">
							<label>客户名称</label>
							<input type="text" name="clientName" value="${(cond.clientName)!}" onClick="ClientId(clientName,clientId)" class="input-text">
							<input type="hidden" name="clientId" id="clientId" value="${(cond.clientId)!}">
						</div>
						<div class="report_item4 cl">
							<input type="reset" class="btn btn-default radius" value="清空">
							<input type="button" class="btn btn-primary radius mr-20 btn_submit" value="查询">
						</div>
					</div>
				</div>
			</form>
		</div>
		<div id="tab_demo" class="HuiTab mt-10">		
	  		<div class="myTabBar myClearfix " ><span>国泰</span><span>其他航司</span></div>
	  		<div class="myTabCon create_order_box">
	  			<div class="report_content">
		  			<table class="table table-border table-bordered radius">
		  				<thead class="text-c">
		  					<tr>
		  						<th rowspan='3' width="100">客户名称</th>
		  						<th rowspan='3' width="100">商户代码</th>
		  						<th colspan='3' width="300">任务</th>
		  						<th rowspan='3' width="100">国际本月销售新增</th>
		  						<th colspan='10' ><span class="date_condition_span">按出票日期统计</span></th>
		  					</tr>
		  					<tr>
		  						<th colspan='2' width="200">协议有效期</th>
		  						<th width="100">任务量(元)</th>
		  						<th colspan='2' width="140">小计</th>
		  						<th colspan='2' width="140">第一季</th>
		  						<th colspan='2' width="140">第二季</th>
		  						<th colspan='2' width="140">第三季</th>
		  						<th colspan='2' width="140">第四季</th>
		  					</tr>
		  					<tr>
		  						<th width="100">起</th>
		  						<th width="100">止</th>
		  						<th width="100">国际</th>
		  						<th width="70">销售总量</th>
		  						<th width="70">退废</th>
		  						<th width="70">销售总量</th>
		  						<th width="70">退废</th>
		  						<th width="70">销售总量</th>
		  						<th width="70">退废</th>
		  						<th width="70">销售总量</th>
		  						<th width="70">退废</th>
		  						<th width="70">销售总量</th>
		  						<th width="70">退废</th>
		  					</tr>
		  				</thead>
		  				<tbody>
		  					<#if reportsMap.cZReports??>
								<#list reportsMap.cZReports! as report>				
				  					<tr class="text-c">
				  						<td>${report.clientName!''}</td>
				  						<td>${report.clientBusinessCode!''}</td>
				  						<td>${report.protocolDateStartStr!''}</td>
				  						<td>${report.protocolDateEndStr!''}</td>
				  						<td>${report.taskStr!''}</td>
				  						<td></td>
				  						<td>${report.totalAmountStr!''}</td>
				  						<td>${report.totalRefundInvalidAmountStr!''}</td>
				  						<td>${report.firstQuqrterTotalAmountStr!''}</td>
				  						<td>${report.firstQuqrterTotalRefundInvalidAmountStr!''}</td>
				  						<td>${report.secondQuqrterTotalAmountStr!''}</td>
				  						<td>${report.secondQuqrterTotalRefundInvalidAmountStr!''}</td>
				  						<td>${report.thirdQuqrterTotalAmountStr!''}</td>
				  						<td>${report.thirdQuqrterTotalRefundInvalidAmountStr!''}</td>
				  						<td>${report.fourthQuqrterTotalAmountStr!''}</td>
				  						<td>${report.fourthQuqrterTotalRefundInvalidAmountStr!''}</td>
				  					</tr>
				  				</#list>
				  			<#else>
				  				<tr>
				  					<td colspan="16">暂无统计记录</td>
				  				</tr>
				  			</#if>
		  				</tbody>
		  			</table>
		  		</div>
	  		</div>
	  		<div class="myTabCon create_order_box text-c">
	  			<div class="report_content">
		  			<table class="table table-border table-bordered radius">
		  				<thead class="text-c">
		  					<tr>
		  						<th rowspan='3' width="150">航司名称</th>
		  						<th rowspan='3' width="150">客户名称</th>
		  						<th rowspan='3' width="170">商户代码</th>
		  						<th colspan='3' width="300">任务</th>
		  						<th rowspan='3' width="100">国际本月销售新增</th>
		  						<th colspan='2' width="300"><span class="date_condition_span">按出票日期统计</span></th>
		  					</tr>
		  					<tr>
		  						<th colspan='2' width="200">协议有效期</th>
		  						<th width="100">任务量(元)</th>
		  						<th colspan='2' width="300">小计</th>
		  						
		  					</tr>
		  					<tr>
		  						<th width="100">起</th>
		  						<th width="100">止</th>
		  						<th width="100">国际</th>
		  						<th width="150">销售总量</th>
		  						<th width="150">退废</th>
		  					</tr>
		  				</thead>
		  				<tbody>
		  					<#if reportsMap.reports??>
								<#list reportsMap.reports! as report>				
				  					<tr class="text-c">
				  						<td>${report.airlineName!''}</td>
				  						<td>${report.clientName!''}</td>
				  						<td>${report.clientBusinessCode!''}</td>
				  						<td>${report.protocolDateStartStr!''}</td>
				  						<td>${report.protocolDateEndStr!''}</td>
				  						<td>${report.taskStr!''}</td>
				  						<td></td>
				  						<td>${report.totalAmountStr!''}</td>
				  						<td>${report.totalRefundInvalidAmountStr!''}</td>
				  					</tr>
				  				</#list>
				  			<#else>
				  				<tr>
				  					<td colspan="9">暂无统计记录</td>
				  				</tr>
				  			</#if>
		  				</tbody>
		  			</table>
		  		</div>
	  		</div>
	  	</div>
	  	<div class="report_content" id="cz_airline" style="display:none">
  			<table class="table table-border table-bordered radius">
  				<thead class="text-c">
  					<tr>
  						<th rowspan='3' width="100">客户名称</th>
  						<th rowspan='3' width="100">商户代码</th>
  						<th colspan='3' width="300">任务</th>
  						<th rowspan='3' width="100">国际本月销售新增</th>
  						<th colspan='10' ><span class="date_condition_span">按出票日期统计</span></th>
  					</tr>
  					<tr>
  						<th colspan='2' width="200">协议有效期</th>
  						<th width="100">任务量(元)</th>
  						<th colspan='2' width="140">小计</th>
  						<th colspan='2' width="140">第一季</th>
  						<th colspan='2' width="140">第二季</th>
  						<th colspan='2' width="140">第三季</th>
  						<th colspan='2' width="140">第四季</th>
  					</tr>
  					<tr>
  						<th width="100">起</th>
  						<th width="100">止</th>
  						<th width="100">国际</th>
  						<th width="70">销售总量</th>
  						<th width="70">退废</th>
  						<th width="70">销售总量</th>
  						<th width="70">退废</th>
  						<th width="70">销售总量</th>
  						<th width="70">退废</th>
  						<th width="70">销售总量</th>
  						<th width="70">退废</th>
  						<th width="70">销售总量</th>
  						<th width="70">退废</th>
  					</tr>
  				</thead>
  				<tbody>
  					<#if reportsMap.cZReports??>
						<#list reportsMap.cZReports! as report>				
		  					<tr class="text-c">
		  						<td>${report.clientName!''}</td>
		  						<td>${report.clientBusinessCode!''}</td>
		  						<td>${report.protocolDateStartStr!''}</td>
		  						<td>${report.protocolDateEndStr!''}</td>
		  						<td>${report.taskStr!''}</td>
		  						<td></td>
		  						<td>${report.totalAmountStr!''}</td>
		  						<td>${report.totalRefundInvalidAmountStr!''}</td>
		  						<td>${report.firstQuqrterTotalAmountStr!''}</td>
		  						<td>${report.firstQuqrterTotalRefundInvalidAmountStr!''}</td>
		  						<td>${report.secondQuqrterTotalAmountStr!''}</td>
		  						<td>${report.secondQuqrterTotalRefundInvalidAmountStr!''}</td>
		  						<td>${report.thirdQuqrterTotalAmountStr!''}</td>
		  						<td>${report.thirdQuqrterTotalRefundInvalidAmountStr!''}</td>
		  						<td>${report.fourthQuqrterTotalAmountStr!''}</td>
		  						<td>${report.fourthQuqrterTotalRefundInvalidAmountStr!''}</td>
		  					</tr>
		  				</#list>
		  			<#else>
		  				<tr>
		  					<td colspan="16">暂无统计记录</td>
		  				</tr>
		  			</#if>
  				</tbody>
  			</table>
  		</div>
  		<div class="report_content" id="others_airline" style="display:none">
  			<table class="table table-border table-bordered radius">
  				<thead class="text-c">
  					<tr>
  						<th rowspan='3' width="150">航司名称</th>
  						<th rowspan='3' width="150">客户名称</th>
  						<th rowspan='3' width="170">商户代码</th>
  						<th colspan='3' width="300">任务</th>
  						<th rowspan='3' width="100">国际本月销售新增</th>
  						<th colspan='2' width="300"><span class="date_condition_span">按出票日期统计</span></th>
  					</tr>
  					<tr>
  						<th colspan='2' width="200">协议有效期</th>
  						<th width="100">任务量(元)</th>
  						<th colspan='2' width="300">小计</th>
  						
  					</tr>
  					<tr>
  						<th width="100">起</th>
  						<th width="100">止</th>
  						<th width="100">国际</th>
  						<th width="150">销售总量</th>
  						<th width="150">退废</th>
  					</tr>
  				</thead>
  				<tbody>
  					<#if reportsMap.reports??>
						<#list reportsMap.reports! as report>				
		  					<tr class="text-c">
		  						<td>${report.airlineName!''}</td>
		  						<td>${report.clientName!''}</td>
		  						<td>${report.clientBusinessCode!''}</td>
		  						<td>${report.protocolDateStartStr!''}</td>
		  						<td>${report.protocolDateEndStr!''}</td>
		  						<td>${report.taskStr!''}</td>
		  						<td></td>
		  						<td>${report.totalAmountStr!''}</td>
		  						<td>${report.totalRefundInvalidAmountStr!''}</td>
		  					</tr>
		  				</#list>
		  			<#else>
		  				<tr>
		  					<td colspan="9">暂无统计记录</td>
		  				</tr>
		  			</#if>
  				</tbody>
  			</table>
  		</div>	
	</div>
</body>
<script>
$(function() {
	//导航点击函数
	$.Huitab("#tab_demo .myTabBar span","#tab_demo .myTabCon","myCurrent","click","0");
	//日期条件初始化
	$.dateCondition();
	// 给提交按钮绑定点击事件
	$(".div_bar").on("click", "input[type='button']", function() {
		$(".div_bar").find("input[type='hidden']").each(function(index, dom) {
			if ($(dom).prev().val() == '') {
				$(dom).val('');
			}
		})
		$("#pageIndex").val(1);
		$("#form").submit();
	});
	// 给清空按钮绑定点击事件
	$("input[type='reset']").click(function() {
		$(':input', '#form').not(':button, :submit, :reset, select').val('');
	});
	
	$(".date_conditio_span")
	showTable();
	showDateCondition();
})
function showDateCondition(){
	if($("#date_condition").val() == "operatoringTime"){
		$(".date_condition_span").html("按出票日期统计");
	}else{//departureDate
		$(".date_condition_span").html("按乘机日期统计");
	}
}
function showTable(){
	if($("#airline").val() !=''){
		$("#tab_demo").hide()
		if($("#airline").val() == 'CX'){
			$("#cz_airline").show()
		}else{
			$("#others_airline").show()
		}
	}
}

</script>
</html>